<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D旋转</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        body {
            background-color: pink;
            overflow: hidden;
        }

        .wrapper {
            perspective: 800px;
        }

        .wrapper .turn {
            /* 旋转体位置  */
            position: relative;
            top: 50px;
            left: 50%;
            margin-left: -150px;

            /* 旋转体样多 */
            width: 300px;
            height: 200px;
            border-radius: 8px;
            background-color: white;
            text-align: center;
            font-size: 28px;

            /* 元素水平垂直居中 */
            display: flex;
            justify-content: center;
            align-items: center;

            /* 开启3D效果 */
            transform-style: preserve-3d;

            /* 过渡动画 */
            transition: transform .8s;
            /* 盒子阴影 */
            box-shadow: 0 4px 18px rgba(88, 87, 87, 0.5)
        }

        /* 正反面 */
        .wrapper .turn div {
            /* 正反面重叠 */
            position: absolute;
            /* 开启3D效果 */
            transform-style: preserve-3d;
            /* 背景 */
            background-color: rebeccapurple;
        }

        /* 注册界面先旋转180deg */
        .wrapper .turn .sign {
            transform: rotateY(180deg);
            background-color: green;
        }

        /* 鼠标移入旋转180deg */
        .wrapper .turn:hover {
            transform: rotateY(180deg);

        }
    </style>
</head>

<body>
    <div class="wrapper">
        <div class="turn">
            <div class="login">登录界面</div>
            <div class="sign">加入我们</div>
        </div>
    </div>
</body>

</html>